package cn.jiyun.service.impl;

import cn.jiyun.dao.Odao;
import cn.jiyun.pojo.Order;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Oservice implements cn.jiyun.service.Oservice {
    @Resource
    private Odao odao;

    @Override
    public Order all(Long id) {
        return odao.selectById(id);
    }



    @Override
    public void del(Long id) {
        odao.deleteById(id);
    }

    @Override
    public void add(Order order) {
        odao.insert(order);
    }

    @Override
    public void update(Order order) {

        odao.updateByIdzx(order);
    }

    @Override
    public Page<Order> qc(Page<Order> page1,String  input) {
        QueryWrapper qw=new QueryWrapper();
        qw.like(input!=null,"name",input);
        return odao.selectPage(page1,qw);
    }
}
